﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Leikjavefurinn.Context;

namespace Leikjavefurinn.Controllers
{
    public class ActiveGameController : Controller
    {
        //Næ í alla leiki sem eru í gangi
        public ActionResult Index()
        {
            var db = new LeikjavefurEntities();
            var active = (from s in db.GameStatus
                          where s.IsActive == true
                          select s);
            return View(active);
        }

        //Næ í 5 leiki sem vantar notenda
        public ActionResult AGFeed()
        {
            var db = new LeikjavefurEntities();
            var active = from s in db.GameStatus
                         orderby s.IsWaiting descending
                         select s;
            return View(active.Take(5));
        }
    }
}
